<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>position:absolute定位</title>
    <!--absolute在没有设定TRBL值时是根据父级对象的坐标作为始点的，
    当设定TRBL值后则根据浏览器的左上角作为原始点-->
    <style type="text/css">
        html, body, div {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        .center {
            margin: 30px;
            border: #999999 solid 10px;
            width: 400px;
            height: 300px;
        }

        .div1 {
            width: 200px;
            height: 200px;
            background: #0099FF;
            /*设定TRBL*/
            position: absolute;
            left: 0px;
            top: 0px;
        }

        .div2 {
            width: 400px;
            height: 300px;
            font-size: 30px;
            font-weight: bold;
            color: #fff;
            background: #FF0000;
        }
    </style>
</head>

<body>
<div class="center">
    <div class="div1"></div>
    <div class="div2">position:absolute定位测试</div>
</div>
</body>

</html>